<?php
set_time_limit(12000000);
require("../inc/common.inc.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<TITLE>铭讯EOS网站后台管理</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<Meta name="Keywords" Content="济南网站建设 济南网站制作 山东网站建设 济南铭讯软件有限公司">
<Meta name="Description" Content="济南网站制作：铭讯软件专业服务优秀企业，致力于网站建、设网站推广、网络营销一体的全访位网络服务商">
<link rel="stylesheet" href="../images/style.css" type="text/css">
</head>
<body> 
<?php
$rs=$db->excu("select * from mx_user order by id");
if ($db->num_rows($rs)>0){
	$i=0;
	while($rsdb=$db->fetch_array($rs)){
	$i++;
	$wxuserinfo=wx_get_userinfo($rsdb["weixinid"]);
	if (is_array($wxuserinfo)){
		if ($wxuserinfo["subscribe"]==0){
			$files=array(
			"isguanzhu"=>$wxuserinfo["subscribe"],
			);
		}
		else{
			$files=array(
			"nicheng"=>$wxuserinfo["nickname"],
			"sex"=>$wxuserinfo["sex"],
			"wx_shi"=>$wxuserinfo["city"],
			"wx_guo"=>$wxuserinfo["country"],
			"wx_sheng"=>$wxuserinfo["province"],
			"wx_language"=>$wxuserinfo["language"],
			"faceurl"=>$wxuserinfo["headimgurl"],
			"isguanzhu"=>$wxuserinfo["subscribe"],
			"guandate"=>date("Y-m-d H:i:s",$wxuserinfo["subscribe_time"]),
			);
		}
		$db->exe_update("mx_user",$files,"id='$rsdb[id]'");
	}
	echo "$i<br>";
	flush();
	}
}
echo "ok";
?>
</body>
</html>
